'''
Created on 2019年6月19日

@author: Administrator
'''
ENV = 'dev'
SYS_ID = 'jenkins_tool'

Log_config_file_name = 'jenkins.log'
Log_config_dir = '/leadbank/jenkins_tool/log4py/'
"""
logging level. from logging module
CRITICAL = 50
FATAL = CRITICAL
ERROR = 40
WARNING = 30
WARN = WARNING
INFO = 20
DEBUG = 10
NOTSET = 0
"""
Logging_command_level = 10
Logging_file_level = 20

STR_GBK = 'gbk'
STR_UTF = 'utf-8'
OPR_BUY = 'B'
OPR_SELL = 'S'
OPR_KEEP = 'K'

SOURCE_TYPE_CSV = 'csv'
SOURCE_TYPE_CSV_LOWER = 'csv'
SOURCE_TYPE_MONGO = 'MONGO'
SOURCE_TYPE_REDIS = 'REDIS'
SOURCE_TYPE_DB = 'DB'

REDIS_HOST = '10.1.1.1'
REDIS_PORT = 9988
REDIS_MAX_CONNECTIONS = 10
REDIS_TIMEOUT_SECONDS = 24 * 60 * 60

# 10.1.1.63:7000|||10.1.1.63:7001|||10.1.1.63:7002|||10.1.1.63:7003|||10.1.1.63:7004|||10.1.1.63:7005
REDIS_STARTUONODES = [
    {"host": "10.1.1.63", "port": 7000},
    {"host": "10.1.1.63", "port": 7001},
    {"host": "10.1.1.63", "port": 7002},
    {"host": "10.1.1.63", "port": 7003},
    {"host": "10.1.1.63", "port": 7004},
    {"host": "10.1.1.63", "port": 7005}
]

SYS_USE_CACHE_FLG = False

# DB
# mongoDB_config
MONGODB_ip = '10.1.13.103'
MONGODB_port = 27017
MONGODB_user_name = 'leaduser'
MONGODB_user_pwd = '123456789'
MONGODB_use_db = 'leadDB'

"""
mysql config 
"""
MYSQL_dialect = "mysql"
# change to pymysql instead of mysqldb due to connect issue
MYSQL_driver = "pymysql"
MYSQL_CONFIG = {
    'redmine': {'host': '10.1.1.135',
                'port': 3306,
                'schema': 'redmine',
                'user': 'redmine',
                'password': 'redmine',
                'charset': 'utf8'}
    ,
    'zeus': {
        'host': '10.1.1.203',
        'port': 3306,
        'schema': 'zeus',
        'user': 'zeus',
        'password': 'zeus',
        'charset': 'utf8'
    }

}

# 最大连接数
MYSQL_maxconnections = 3

# 初始化时,连接池至少创建的空闲连接,0表示不创建
MYSQL_mincached = 2

# 连接池中空闲的最多连接数,0和None表示没有限制
MYSQL_maxcached = 5

# 连接池中最多共享的连接数量,0和None表示全部共享
MYSQL_maxshared = 3

# 连接池中如果没有可用共享连接后,是否阻塞等待,True表示等等,
# False表示不等待然后报错
MYSQL_blocking = True

# 开始会话前执行的命令列表
MYSQL_setsession = []

# ping Mysql服务器检查服务是否可用
MYSQL_ping = 10

# 最大连接数
ORACLE_maxconnections = 3

# 初始化时,连接池至少创建的空闲连接,0表示不创建
ORACLE_mincached = 2

# 连接池中空闲的最多连接数,0和None表示没有限制
ORACLE_maxcached = 5

# 连接池中最多共享的连接数量,0和None表示全部共享
ORACLE_maxshared = 3

# 连接池中如果没有可用共享连接后,是否阻塞等待,True表示等等,
# False表示不等待然后报错
ORACLE_blocking = True

# 开始会话前执行的命令列表
ORACLE_setsession = []

# ping ORACLE服务器检查服务是否可用
ORACLE_ping = 10

ORACLE_user = 'mfund'
ORACLE_password = 'mfund'
ORACLE_host = '10.1.1.222'
ORACLE_database = 'orcl'
ORACLE_port = 1521

ORACLE_CONFIG = {
    'host': '10.1.1.222',
    'port': 1521,
    'database': 'ORCL',
    'user': 'mfund',
    'password': 'mfund',
    'charset': 'utf8'
}

# jenkins config
JENKINS_HOST = '10.1.1.133'
JENKINS_PORT = 8080
JENKINS_USERNAME = 'guihe'
JENKINS_PWD = 'woshiguihe'

# pre and prod jenkins
PROD_JENKINS_HOST = '10.34.30.39'
PROD_JENKINS_PORT = 8080
PROD_JENKINS_USERNAME = 'prodjenkins'
PROD_JENKINS_PWD = 'prodjenkins'

# jenkins build param
# opser
OPSER = 'caikai'
# memo
MEMO = 'auto generated by jenkins_tool'
EXCEPTION_INFO = 'bug fix'

# CROWD SERVER
CROWD_SERVER = 'http://10.1.1.135:8780/'
CROWD_USER = 'release'
CROWD_PASSWORD = 'release'

# zeus deploy query api
ZEUS_QUERY_API_URL = "http://10.34.30.229/zeusapi/leadbank/data/getDeployList.action?unitName={}&envId={" \
                     "}&page=1&limit=999"
# <option value="22">万国生产</option>
# <option value="23">万国预发</option>
# <option value="15">商户联调</option>
# <option value="2">第一套测试环境</option>
# <option value="1">开发环境</option>
ZEUS_ENV = {
    "pre": "23",
    "prod": "22",
    "dev": "1",
    "test1": "2",
    "merchant_integrate_test": "15"

}
